home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC]
/
NeXTSTEP 3.3 Dev Intel.iso
/
usr
/
sybase
/
include4_6
/
sybdb.h
next >
Wrap
C/C++ Source or Header
|
1993-04-22
|
131KB
|
2,835 lines
/*
** sybdb.h 77.1 11/11/91
**
** Sybase DB-LIBRARY Version 4.6
** Confidential Property of Sybase, Inc.
** (c) Copyright Sybase, Inc. 1988, 1990
** All rights reserved
**
**
** Use, duplication, or disclosure by the Government
** is subject to restrictions as set forth in subparagraph (c) (1) (ii)
** of the Rights in Technical Data and Computer Software clause
** at DFARS 52.227-7013. Sybase, Inc. 6475 Christie Avenue, Emeryville,
** CA 94608.
**
*/
#ifndef __sybdb__
#define __sybdb__
#if MAC
#include <Memory.h>
#endif /* MAC */
/* temporarily undef ABS since there is one in sybdbtokens.h */
#ifdef ABS
#undef ABS
#endif /* ABS */
#include <sybdbtoken.h>
#ifdef ABS
#undef ABS
#endif /* ABS */
#define ABS(a) ((a) > 0 ? (a) : -(a))
/*
** Status code for dbnextrow() and dbgetrow().
** Return of > 0 indicates ALTROW.
** FAIL is another possible return.
*/
#define MORE_ROWS -1
#define NO_MORE_ROWS -2
#define REG_ROW MORE_ROWS
#define BUF_FULL -3
/*
** Return code for dbreadtext().
*/
#define NO_MORE_PARAMS -4
/*
** Status code for dbresults(). Possible return values are
** SUCCEED, FAIL, and NO_MORE_RESULTS.
*/
#define NO_MORE_RESULTS 2
/*
** Return code for message-handlers. Indicates whether or not the handler
** wants DB-LIBRARY to buffer the current Server message for later use
** by the program.
*/
#define DBSAVE 1
#define DBNOSAVE 0
#define DBNOERR -1
/*
** Default size of row buffer. This is what people get if they do
** a dbsetopt(dbproc, DBBUFFER, 0).
*/
#define DBBUFSIZE 1000
/* The size of a SYBTEXT timestamp, in bytes. This timestamp is not to be
* confused with a browse-mode timestamp.
*/
#define DBTXTSLEN 8
/* The size of a text-pointer, in bytes. */
#if !VMS
#define DBTXPLEN ((DBTINYINT)16)
#else
#define DBTXPLEN ((unsigned char)16)
#endif
/*
** this is defined in the SQL Server server.h but it has alot of other
** stuff that we don't want.
*/
#define DBMAXNAME 30 /* Less like to collide with users' names
* than "MAXNAME".
*/
#define MAXNAME 30 /* Still here, so old programs won't
* break yet.
*/
#define MINSECLEVEL 1
#define MAXSECLEVEL 16
#include <syblogin.h>
#define DBMAXCHAR 256
#define DBMAXCOLNAME 30
#define DBMAXBYLIST 16
#define DBDATE_YY 0 /* year 1753 - 9999 */
#define DBDATE_QQ 1 /* quarter 1 - 4 */
#define DBDATE_MM 2 /* month January - December */
#define DBDATE_DW 3 /* weekday Monday - Sunday */
#define DBDATE_DD 4 /* day 1 - 31 */
#define DBDATE_DY 5 /* dayofyear 1 - 366 */
#define DBDATE_HH 6 /* hour 0 - 23 */
#define DBDATE_MI 7 /* minute 0 - 59 */
#define DBDATE_SS 8 /* second 0 - 59 */
#define DBDATE_MS 9 /* millisecond 0 - 999 */
#define DBDATE_WK 10 /* week 1 - 54 (for leap years) */
/* maximum printing lengths for fixed-length data */
#define PRINT4 11
#define PRINT2 6
#define PRINT1 3
#define PRFLT8 20
#define PRFLT4 20
#define PRMONEY 24
#define PRMONEY4 24
#define PRBIT 1
#define PROLDDATETIME 20 /* for backward compatibility */
#define PRDATETIME 26
#define PRDATETIME4 26
#define PRLDATETIME 30 /* includes milliseconds */
/* constant definitions for dbsafestr()'s quotetype parameter */
#define DBSINGLE 0
#define DBDOUBLE 1
#define DBBOTH 2
/* status values returned by dbxlate() */
#define DBXLATE_XOK 0
#define DBXLATE_XOF 1
#define DBXLATE_XPAT 2
/* SQL Server variable typedefs */
typedef unsigned short DBUSMALLINT; /* SQL Server 2 byte integer */
typedef struct dbvarychar /* Pascal-type string. */
{
DBSMALLINT len; /* length of the character string */
DBCHAR str[DBMAXCHAR]; /* string, with no NULL terminator */
} DBVARYCHAR;
typedef struct dbvarybin /* Pascal-type binary array. */
{
DBSMALLINT len; /* length of the binary array */
BYTE array[DBMAXCHAR];/* the array itself. */
} DBVARYBIN;
#define TINYBIND 1
#define SMALLBIND 2
#define INTBIND 3
#define CHARBIND 4
#define TEXTBIND 5
#define BINARYBIND 6
#define ARRAYBIND 7
#define BITBIND 8
#define DATETIMEBIND 9
#define MONEYBIND 10
#define FLT8BIND 11
#define STRINGBIND 12
#define NTBSTRINGBIND 13
#define VARYCHARBIND 14
#define VARYBINBIND 15
#define SMALLDATETIMEBIND 16
#define SMALLMONEYBIND 17
#define REALBIND 18
#if VOS
#define FIXEDBIND 19 /*kvk589*/
#define PACKEDBIND 20 /*kvk589*/
#define MAXBIND PACKEDBIND /*kvk589*/
#else
#define MAXBIND REALBIND
#endif
/*
** From pss.h SQL Server structure.
*/
/* Donepacket status bit defs go here */
# define DONE_CONT (DBUSMALLINT) 0x1
# define DONE_ERROR (DBUSMALLINT) 0x2
# define DONE_INXACT (DBUSMALLINT) 0x4
# define DONE_PROC (DBUSMALLINT) 0x8
# define DONE_COUNT (DBUSMALLINT) 0x10
# define DONE_ATTN (DBUSMALLINT) 0x20
# define DONE_EVENT (DBUSMALLINT) 0x40
/*
** OFFSETS DEFINITIONS
**
** These are a subset of the token values for offset information.
** These defines come from y.tab.h
**
*/
#define _SELECT 365
#define _EXECUTE 330
#define _FROM 335
#define _ORDER 357
#define _COMPUTE 313
#define _TABLE 371
#define _PROCEDURE 362
#define _STATEMENT 459
#define _PARAM 452
/* end y.tab.h */
/* DB-LIBRARY minor error numbers */
#define SYBESYNC 20001 /* Read attempted while out of synchronization
* with SQL Server.
*/
#define SYBEFCON 20002 /* SQL Server connection failed. */
#define SYBETIME 20003 /* SQL Server connection timed out. */
#define SYBEREAD 20004 /* Read from SQL Server failed. */
#define SYBEBUFL 20005 /* DB-LIBRARY internal error - send buffer
* length corrupted.
*/
#define SYBEWRIT 20006 /* Write to SQL Server failed. */
#define SYBEVMS 20007 /* Sendflush: VMS I/O error. */
#define SYBESOCK 20008 /* Unable to open socket */
#define SYBECONN 20009 /* Unable to connect socket -- SQL Server is
* unavailable or does not exist.
*/
#define SYBEMEM 20010 /* Unable to allocate sufficient memory */
#define SYBEDBPS 20011 /* Maximum number of DBPROCESSes
* already allocated.
*/
#define SYBEINTF 20012 /* Server name not found in interface file */
#define SYBEUHST 20013 /* Unknown host machine name */
#define SYBEPWD 20014 /* Incorrect password. */
#define SYBEOPIN 20015 /* Could not open interface file. */
#define SYBEINLN 20016 /* Interface file: unexpected end-of-line. */
#define SYBESEOF 20017 /* Unexpected EOF from SQL Server. */
#define SYBESMSG 20018 /* General SQL Server error: Check messages
* from the SQL Server.
*/
#define SYBERPND 20019 /* Attempt to initiate a new SQL Server
* operation with results pending.
*/
#define SYBEBTOK 20020 /* Bad token from SQL Server: Data-stream
* processing out of sync.
*/
#define SYBEITIM 20021 /* Illegal timeout value specified. */
#define SYBEOOB 20022 /* Error in sending out-of-band data to
* SQL Server.
*/
#define SYBEBTYP 20023 /* Unknown bind type passed to DB-LIBRARY
* function.
*/
#define SYBEBNCR 20024 /* Attempt to bind user variable to a
* non-existent compute row.
*/
#define SYBEIICL 20025 /* Illegal integer column length returned by
* SQL Server. Legal integer lengths are 1, 2,
* and 4 bytes.
*/
#define SYBECNOR 20026 /* Column number out of range. */
#define SYBENPRM 20027 /* NULL parameter not allowed for this
* dboption.
*/
#define SYBEUVDT 20028 /* Unknown variable-length datatype encountered.
*/
#define SYBEUFDT 20029 /* Unknown fixed-length datatype encountered. */
#define SYBEWAID 20030 /* DB-LIBRARY internal error: ALTFMT following
* ALTNAME has wrong id.
*/
#define SYBECDNS 20031 /* Datastream indicates that a compute column is
* derived from a non-existent select-list
* member.
*/
#define SYBEABNC 20032 /* Attempt to bind to a non-existent column. */
#define SYBEABMT 20033 /* User attempted a dbbind() with mismatched
* column and variable types.
*/
#define SYBEABNP 20034 /* Attempt to bind using NULL pointers. */
#define SYBEAAMT 20035 /* User attempted a dbaltbind() with mismatched
* column and variable types.
*/
#define SYBENXID 20036 /* The Server did not grant us a
* distributed-transaction ID.
*/
#define SYBERXID 20037 /* The Server did not recognize our
* distributed-transaction ID.
*/
#define SYBEICN 20038 /* Invalid computeid or compute column number.
*/
#define SYBENMOB 20039 /* No such member of 'order by' clause. */
#define SYBEAPUT 20040 /* Attempt to print unknown token. */
#define SYBEASNL 20041 /* Attempt to set fields in a null loginrec. */
#define SYBENTLL 20042 /* Name too long for loginrec field. */
#define SYBEASUL 20043 /* Attempt to set unknown loginrec field. */
#define SYBERDNR 20044 /* Attempt to retrieve data from a non-existent
* row.
*/
#define SYBENSIP 20045 /* Negative starting index passed to dbstrcpy().
*/
#define SYBEABNV 20046 /* Attempt to bind to a NULL program variable.
*/
#define SYBEDDNE 20047 /* DBPROCESS is dead or not enabled. */
#define SYBECUFL 20048 /* Data-conversion resulted in underflow. */
#define SYBECOFL 20049 /* Data-conversion resulted in overflow. */
#define SYBECSYN 20050 /* Attempt to convert data stopped by syntax
* error in source field.
*/
#define SYBECLPR 20051 /* Data-conversion resulted in loss of
* precision.
*/
#define SYBECNOV 20052 /* Attempt to set variable to NULL resulted
* in overflow.
*/
#define SYBERDCN 20053 /* Requested data-conversion does not exist. */
#define SYBESFOV 20054 /* dbsafestr() overflowed its destination
* buffer.
*/
#define SYBEUNT 20055 /* Unknown network type found in
* interface file.
*/
#define SYBECLOS 20056 /* Error in closing network connection. */
#define SYBEUAVE 20057 /* Unable to allocate VMS event flag. */
#define SYBEUSCT 20058 /* Unable to set communications timer. */
#define SYBEEQVA 20059 /* Error in queueing VMS AST routine. */
#define SYBEUDTY 20060 /* Unknown datatype encountered. */
#define SYBETSIT 20061 /* Attempt to call dbtsput() with an
* invalid timestamp.
*/
#define SYBEAUTN 20062 /* Attempt to update the timestamp of a table
* which has no timestamp column.
*/
#define SYBEBDIO 20063 /* Bad bulk-copy direction. Must be either
* IN or OUT.
*/
#define SYBEBCNT 20064 /* Attempt to use Bulk Copy with a non-existent
* Server table.
*/
#define SYBEIFNB 20065 /* Illegal field number passed to bcp_control().
*/
#define SYBETTS 20066 /* The table which bulk-copy is attempting to
* copy to a host-file is shorter than the
* number of rows which bulk-copy was instructed
* to skip.
*/
#define SYBEKBCO 20067 /* 1000 rows successfully bulk-copied to
* host-file.
*/
#define SYBEBBCI 20068 /* Batch successfully bulk-copied to SQL Server.
*/
#define SYBEKBCI 20069 /* Bcp: 1000 rows sent to SQL Server. */
#define SYBEBCRE 20070 /* I/O error while reading bcp data-file. */
#define SYBETPTN 20071 /* Syntax error: only two periods are permitted
* in table names.
*/
#define SYBEBCWE 20072 /* I/O error while writing bcp data-file. */
#define SYBEBCNN 20073 /* Attempt to bulk-copy a NULL value into
* Server column %d, which does not accept
* NULL values.
*/
#define SYBEBCOR 20074 /* Attempt to bulk-copy an oversized row to the
* SQL Server.
*/
#define SYBEBCIS 20075 /* Attempt to bulk-copy an illegally-sized
* column value to the SQL Server.
*/
#define SYBEBCPI 20076 /* bcp_init() must be called before any other
* bcp routines.
*/
#define SYBEBCPN 20077 /* bcp_bind(), bcp_collen() and bcp_colptr()
* may be used only after bcp_init() has been
* called with the copy direction set to DB_IN.
*/
#define SYBEBCPB 20078 /* bcp_bind() may NOT be used after bcp_init()
* has been passed a non-NULL input file name.
*/
#define SYBEVDPT 20079 /* For bulk copy, all variable-length data
* must have either a length-prefix or a
* terminator specified.
*/
#define SYBEBIVI 20080 /* bcp_columns() and bcp_colfmt() may be used
* only after bcp_init() has been passed a
* valid input file.
*/
#define SYBEBCBC 20081 /* bcp_columns() must be called before
* bcp_colfmt().
*/
#define SYBEBCFO 20082 /* Bcp host-files must contain at least one
* column.
*/
#define SYBEBCVH 20083 /* bcp_exec() may be called only after
* bcp_init() has been passed a valid host file.
*/
#define SYBEBCUO 20084 /* Bcp: Unable to open host data-file. */
#define SYBEBCUC 20085 /* Bcp: Unable to close host data-file. */
#define SYBEBUOE 20086 /* Bcp: Unable to open error-file. */
#define SYBEBUCE 20087 /* Bcp: Unable to close error-file. */
#define SYBEBWEF 20088 /* I/O error while writing bcp error-file. */
#define SYBEASTF 20089 /* VMS: Unable to setmode for control_c ast. */
#define SYBEUACS 20090 /* VMS: Unable to assign channel to sys$command.
*/
#define SYBEASEC 20091 /* Attempt to send an empty command buffer to
* the SQL Server.
*/
#define SYBETMTD 20092 /* Attempt to send too much TEXT data via the
* dbmoretext() call.
*/
#define SYBENTTN 20093 /* Attempt to use dbtxtsput() to put a new
* text-timestamp into a non-existent data row.
*/
#define SYBEDNTI 20094 /* Attempt to use dbtxtsput() to put a new
* text-timestamp into a column whose datatype
* is neither SYBTEXT nor SYBIMAGE.
*/
#define SYBEBTMT 20095 /* Attempt to send too much TEXT data via the
* bcp_moretext() call.
*/
#define SYBEORPF 20096 /* Attempt to set remote password would
* overflow the login-record's remote-password
* field.
*/
#define SYBEUVBF 20097 /* Attempt to read an unknown version of BCP
* format-file.
*/
#define SYBEBUOF 20098 /* Bcp: Unable to open format-file. */
#define SYBEBUCF 20099 /* Bcp: Unable to close format-file. */
#define SYBEBRFF 20100 /* I/O error while reading bcp format-file. */
#define SYBEBWFF 20101 /* I/O error while writing bcp format-file. */
#define SYBEBUDF 20102 /* Bcp: Unrecognized datatype found in
* format-file.
*/
#define SYBEBIHC 20103 /* Incorrect host-column number found in bcp
* format-file.
*/
#define SYBEBEOF 20104 /* Unexpected EOF encountered in BCP data-file.
*/
#define SYBEBCNL 20105 /* Negative length-prefix found in BCP
* data-file.
*/
#define SYBEBCSI 20106 /* Host-file columns may be skipped only when
* copying INto the Server.
*/
#define SYBEBCIT 20107 /* It's illegal to use BCP terminators with
* program variables other than
* SYBCHAR, SYBBINARY, SYBTEXT, or SYBIMAGE.
*/
#define SYBEBCSA 20108 /* The BCP hostfile '%s' contains only %ld
* rows. Skipping all of these rows is not
* allowed.
*/
#define SYBENULL 20109 /* NULL DBPROCESS pointer passed to DB-Library.
*/
#define SYBEUNAM 20110 /* Unable to get current username from
* operating system.
*/
#define SYBEBCRO 20111 /* The BCP hostfile '%s' contains only %ld
* rows. It was impossible to read the
* requested %ld rows.
*/
#define SYBEMPLL 20112 /* Attempt to set maximum number of DBPROCESSes
* lower than 1.
*/
#define SYBERPIL 20113 /* It is illegal to pass -1 to dbrpcparam()
* for the datalen of parameters which are of
* type SYBCHAR, SYBVARCHAR, SYBBINARY, or
* SYBVARBINARY.
*/
#define SYBERPUL 20114 /* When passing a SYBINTN, SYBDATETIMN,
* SYBMONEYN, or SYBFLTN parameter via
* rpcparam(), it's necessary to specify
* the parameter's maximum or actual length,
* so that DB-Library can recognize it as
* a SYBINT1, SYBINT2, SYBINT4,
* SYBMONEY, or SYBMONEY4, etc.
*/
#define SYBEUNOP 20115 /* Unknown option passed to dbsetopt(). */
#define SYBECRNC 20116 /* The current row is not a result of compute
* clause %d, so it is illegal to attempt to
* extract that data from this row.
*/
#define SYBERTCC 20117 /* dbreadtext() may not be used to receive
* the results of a query which contains a
* COMPUTE clause.
*/
#define SYBERTSC 20118 /* dbreadtext() may only be used to receive
* the results of a query which contains a
* single result column.
*/
#define SYBEUCRR 20119 /* Internal software error: Unknown
* connection result reported by * dbpasswd().
*/
#define SYBERPNA 20120 /* The RPC facility is available only when
* using a SQL Server whose version number
* is 4.0 or greater.
*/
#define SYBEOPNA 20121 /* The text/image facility is available only
* when using a SQL Server whose version number
* is 4.0 or greater.
*/
#define SYBEFGTL 20122 /* Bcp: Row number of the first row to be copied
* cannot be greater than the row number for the
* last row to be copied.
*/
#define SYBECWLL 20123 /* Attempt to set column width less than 1.
*/
#define SYBEUFDS 20124 /* Unrecognized format encountered in
* dbstrbuild().
*/
#define SYBEUCPT 20125 /* Unrecognized custom-format parameter-type
* encountered in dbstrbuild().
*/
#define SYBETMCF 20126 /* Attempt to install too many custom formats
* via dbfmtinstall().
*/
#define SYBEAICF 20127 /* Error in attempting to install custom
* format.
*/
#define SYBEADST 20128 /* Error in attempting to determine the size
* of a pair of translation tables.
*/
#define SYBEALTT 20129 /* Error in attempting to load a pair
* of translation tables.
*/
#define SYBEAPCT 20130 /* Error in attempting to perform a
* character-set translation.
*/
#define SYBEXOCI 20131 /* A character-set translation overflowed its
* destination buffer while using bcp to copy
* data from a host-file to the SQL Server.
*/
#define SYBEFSHD 20132 /* Error in attempting to find the Sybase
* home directory.
*/
#define SYBEAOLF 20133 /* Error in attempting to open a localization
* file.
*/
#define SYBEARDI 20134 /* Error in attempting to read datetime
* information from a localization file.
*/
#define SYBEURCI 20135 /* Unable to read copyright information
* from the dblib localization file.
*/
#define SYBEARDL 20136 /* Error in attempting to read the dblib.loc
* localization file.
*/
#define SYBEURMI 20137 /* Unable to read money-format information
* from the dblib localization file.
*/
#define SYBEUREM 20138 /* Unable to read error mnemonic
* from the dblib localization file.
*/
#define SYBEURES 20139 /* Unable to read error string
* from the dblib localization file.
*/
#define SYBEUREI 20140 /* Unable to read error information from
* the dblib localization file.
*/
#define SYBEOREN 20141 /* Warning: an out-of-range error-number was
* encountered in dblib.loc. The maximum
* permissible error-number is defined
* as DBERRCOUNT in sybdb.h.
*/
#define SYBEISOI 20142 /* Invalid sort-order information found. */
#define SYBEIDCL 20143 /* Illegal datetime column length returned by
* DataServer. Legal datetime lengths are 4
* and 8 bytes.
*/
#define SYBEIMCL 20144 /* Illegal money column length returned by
* DataServer. Legal money lengths are 4
* and 8 bytes.
*/
#define SYBEIFCL 20145 /* Illegal floating-point column length
* returned by DataServer. Legal floating-point
* lengths are 4 and 8 bytes.
*/
#define SYBEUTDS 20146 /* Unrecognized TDS version received from
* SQL Server.
*/
#define SYBEBUFF 20147 /* Bcp: Unable to create format-file. */
#define SYBEACNV 20148 /* Attemp to do conversion with NULL destination
* variable.
*/
#define SYBEDPOR 20149 /* Out-of-range datepart constant. */
#define SYBENDC 20150 /* Cannot have negative component in date
** in numeric form.
*/
#define SYBEMVOR 20151 /* Month values must be between 1 and 12. */
#define SYBEDVOR 20152 /* Day values must be between 1 and 7. */
#define SYBENBVP 20153 /* Cannot pass dbsetnull() a NULL bindval
** pointer.
*/
#define SYBESPID 20154 /* Called dbspid() with a NULL dbproc. */
#define SYBENDTP 20155 /* Called dbdatecrack() with a NULL datetime
** parameter.
*/
#define SYBEXTN 20156 /* The xlt_todisp and xlt_tosrv parameters
** to dbfree_xlate() were NULL.
*/
#define SYBEXTDN 20157 /* Warning: the xlt_todisp parameter to
** dbfree_xlate() was NULL. The space
** associated with the xlt_tosrv parameter
** has been freed.
*/
#define SYBEXTSN 20158 /* Warning: the xlt_tosrv parameter to
** dbfree_xlate() was NULL. The space
** associated with the xlt_todisp parameter
** has been freed.
*/
#define SYBENUM 20159 /* Incorrect number of arguments given
** to DB-Library.
*/
#define SYBETYPE 20160 /* Invalid argument type given to DB-Library. */
#define SYBEGENOS 20161 /* General Operating System Error.*/
#define SYBEPAGE 20162 /* wrong resource type or length given for
** dbpage() operation.
*/
#define SYBEOPTNO 20163 /* Option is not allowed or is unreconized*/
#define SYBEETD 20164 /*"Failure to send the expected amount of
** TEXT or IMAGE data via dbmoretext().
*/
#define SYBERTYPE 20165 /* Invalid resource type given to DB-Library. */
#define SYBERFILE 20166 /* "Can not open resource file." */
#define SYBEFMODE 20167 /* Read/Write/Append mode denied on file.*/
#define SYBESLCT 20168 /* Could not select or copy field specified */
#define SYBEZTXT 20169 /* Attempt to send zero length TEXT or
** IMAGE to dataserver via dbwritetext().
*/
#define SYBENTST 20170 /* The file being opened must be a stream_lf.
*/
#define SYBEOSSL 20171 /* Operating system login level not in range
* of Secure SQL Server
*/
#define SYBEESSL 20172 /* Login security level entered does not agree
* with operating system level
*/
#define SYBENLNL 20173 /* Program not linked with specified
** network library.
*/
#define SYBENHAN 20174 /* called dbrecvpassthru() with a NULL
** handler parameter.
*/
#define SYBENBUF 20175 /* called dbsendpassthru() with a NULL
** buf pointer.
*/
#define SYBENULP 20176 /* Called %s with a NULL %s parameter.
*/
#define SYBENOTI 20177 /* No event handler installed. */
#define SYBEEVOP 20178 /* Called dbregwatch() with a bad
** options parameter.
*/
#define SYBENEHA 20179 /* Called dbreghandle() with a NULL
** handler parameter.
*/
#define SYBETRAN 20180 /* DBPROCESS is being used for another
** transaction.
*/
#define SYBEEVST 20181 /* Must initiate a transaction before
** calling dbregparam().
*/
#define SYBEEINI 20182 /* Must call dbreginit() before
** dbregraise().
*/
#define SYBEECRT 20183 /* Must call dbregdefine() before
** dbregcreate().
*/
#define SYBEECAN 20184 /* Attempted to cancel unrequested
** event notification.
*/
#define SYBEEUNR 20185 /* Unsolicited event notification received.
*/
#define SYBERPCS 20186 /* Must call dbrpcinit() before dbrpcparam().
*/
#define SYBETPAR 20187 /* No SYBTEXT or SYBIMAGE parameters were
** defined.
*/
#define SYBETEXS 20188 /* Called dbmoretext() with a bad size
** parameter.
*/
#define SYBETRAC 20189 /* Attempted to turn off a trace flag
** that was not on.
*/
#define SYBETRAS 20190 /* DB-Library internal error - trace
** structure not found.
*/
#define SYBEPRTF 20191 /* dbtracestring() may only be called
** from a printfunc().
*/
#define SYBETRSN 20192 /* Bad numbytes parameter passed to
** dbtracestring().
*/
#define SYBEBPKS 20193 /* In DBSETLPACKET(), the packet size parameter
** must be between 0 and 999999.
*/
#define SYBEIPV 20194 /* %1! is an illegal value for the %2!
** parameter of %3!.
*/
#define SYBEMOV 20195 /* Money arithmetic resulted in overflow in
** function %1!.
*/
#define SYBEDIVZ 20196 /* Attempt to divide by $0.00 in function
** %1!.
*/
#define SYBEASTL 20197 /* Synchronous I/O attempted at AST level.
*/
#define SYBESEFA 20198 /* DBSETNOTIFS cannot be called if
** connections are present.
*/
#define SYBEPOLL 20199 /* Only one dbpoll() can be active at a
** time.
*/
#define SYBENOEV 20200 /* dbpoll() cannot be called if registered
** procedure notifications have been disabled.
*/
#define SYBEBADPK 20201 /* Packet size of %1! not supported. --
** size of %2! used instead.
*/
/* WARNING: whenever a new DB-Library error message is added,
* increment DBERRCOUNT.
*/
#define DBERRCOUNT 201
/*
** Define the symbol which denotes a null-terminated string length.
*/
#define DBNULLTERM -1
/* These are the codes returned by dbpoll(): */
#define DBRESULT 1
#define DBNOTIFICATION 2
#define DBTIMEOUT 3
#define DBINTERRUPT 4
#if VMS
/* Define the flags for db_readflags */
#define DBRPFILL 1 /* pending recvfill_a completed */
#define DBRPENDING 2 /* pending recvfill_a still pending */
#define DBRPSFILLW 4 /* sync fill invoked and waiting */
#define DBRPASFILLW 8 /* async fill invoked and waiting */
#define DBPOLLWAIT 16 /* dbproc specific dbpoll waiting */
#define DBRPSTART 32 /* read pending start up */
#define DBRPSHUT 64 /* socket/channel shutting down ignore
** and recvfill_a error */
#define DBRNOMORE 128 /* do not read next token */
#define DBRINOPEN 256 /* dbproc is still being opened and
** may need to resize buffers.
** Therefore, we won't do any read
** ahead until after the buffers
** would have been resized.
*/
#define DBPOLLWAIT_A 512 /* asynchronous dbpoll waiting */
#define DBPOLL_TIMER 1024 /* The timer is still set for dbpoll */
#define DBPWTIMEOUT 2048 /* The recvpendwait was timed out */
/* db_vmsflags (in global structure) */
#define DBDOEVENTS 1
/* 16 - DBPOLLWAIT as above same field global function */
/* 512 - DBPOLLWAIT_A as above same field global function */
/* 1024 - DBPOLL_TIMER as above same field global function */
#endif /* VMS */
/* The DBSORTORDER structure is used by dbloadsort(), dbstrcmp(), dbstrsort(),
* and dbfreesort().
*/
typedef struct dbsortorder {
DBVOIDPTR sort;
} DBSORTORDER;
/* The DBDATEREC structure is used by dbdatecrack(): */
typedef struct dbdaterec
{
long dateyear; /* 1900 to the future */
long datemonth; /* 0 - 11 */
long datedmonth; /* 1 - 31 */
long datedyear; /* 1 - 366 */
long datedweek; /* 0 - 6 (Mon. - Sun.) */
long datehour; /* 0 - 23 */
long dateminute; /* 0 - 59 */
long datesecond; /* 0 - 59 */
long datemsecond; /* 0 - 997 */
long datetzone; /* 0 - 127 */
} DBDATEREC;
/*
** HOSTSERVER.h - structures and defines for communicating with server
**
*/
/*
** Data structure used by both send and recv
*/
typedef struct servbuf
{
BYTE *serv_sbuf; /* send: start of send buffer */
BYTE *serv_snb; /* send: next place in buffer */
int serv_sleft; /* send: room left in send buffer */
int serv_sbsize; /* send: buffer size */
int serv_snum; /* send # for network */
int serv_sstat; /* send: status bits */
BYTE *serv_rbuf; /* recv: start of recv buffer */
BYTE *serv_rnb; /* recv: next place in buffer */
int serv_rleft; /* recv: room left in recv buffer */
int serv_rbsize; /* recv: buffer size */
int serv_rnum; /* recv # for network */
int serv_rstat; /* recv: status bits */
int serv_commtype; /* communications type (tcp, etc.) */
RETCODE (*serv_attn)(); /* network-dependent routine to send
* an ATTN packet to the SQL Server.
*/
DBINT (*serv_read)(); /* network-dependent routine to read
* a byte stream from the SQL Server.
*/
RETCODE (*serv_read_a)();/* async version of serv_read(). */
DBINT (*serv_writ)(); /* network-dependent routine to write
* a byte stream to the SQL Server.
*/
RETCODE (*serv_clos)(); /* network-dependent routine to close
* a connection to the SQL Server.
*/
BYTE serv_rbuftype; /* packet type of the last read buffer */
} SERVBUF;
/*
** DBSTRING - This structure is just used for stringing text or parameters
** together.
*/
struct dbstring
{
BYTE *strtext; /* actual byte string */
DBINT strtotlen; /* allocated length of the byte string */
struct dbstring *strnext;
};
typedef struct dbstring DBSTRING;
/*
** DBROWDATA - This structure is used to hold the actual data that
** comes back for every column in every row. The DBPROCESS structure
** points to a linked-list of DBROW structures. Each DBROW strcture points
** to an array of DBROWDATA structures. Since every DBROWDATA structure
** contains pointers to separately allocated buffers, the members of
** each array are linked together in a singly-linked list, to facilitate
** the operation of simple row-freeing routines.
*/
struct dbrowdata
{
BYTE *data; /* actual data for this column in this
* row
*/
DBINT datlen; /* length, in bytes, of this data */
DBINT maxtxtlen; /* This used to keep track of the
* largest SYBTEXT/SYBIMAGE column
* received so far.
*/
DBBINARY dattxptr[DBTXPLEN];/* This data's text-ptr, if it's of
* type SYBTEXT.
*/
DBTINYINT dattxplen; /* Length, in bytes, of the text-ptr. */
DBBINARY dattxts[DBTXTSLEN];/* The text-timestamp of this text
* value.
*/
DBTINYINT dattxtslen; /* Length, in bytes, of the
* text-timestamp.
*/
struct dbrowdata *datnext;
};
typedef struct dbrowdata DBROWDATA;
/*
** BINDREC - This is the structure used to store information about
** which columns should be bound to which programming variables
*/
struct bindrec
{
BYTE *bindvar; /* ptr to program variable */
DBINT bindlen; /* length of program variable */
int (*bindproc)(); /* procedure to use for data copy. */
DBINT *bindnullind; /* IBM-type indicator variable. */
DBINT bindtype; /* variable for indexing convertfunc
** tables.
*/
};
typedef struct bindrec BINDREC;
/*
** NULLBIND - This structure is attached to the DBPROCESS and is used
** to determine what to bind when bind values are NULL.
*/
struct nullbind
{
DBBIT nullbit;
DBTINYINT nulltiny;
DBSMALLINT nullsmall;
DBINT nullint;
DBCHAR *nullchar;
DBINT nulllchar; /* length of char string */
DBBINARY *nullbinary;
DBINT nulllbinary; /* length of binary string */
DBDATETIME nulldatetime;
DBMONEY nullmoney;
DBFLT8 nullflt8;
DBCHAR *nullstring;
DBCHAR *nullntbstring;
DBVARYCHAR nullvarychar;
DBVARYBIN nullvarybin;
DBDATETIME4 nullsmalldatetime;
DBMONEY4 nullsmallmoney;
DBREAL nullflt4;
};
typedef struct nullbind NULLBIND;
/*
** DBCOLINFO - This structure contains the format information about a column.
** There is a linked list of DBCOLINFO structures in the DBPROCESS
** structure. There is one DBCOLINFO structure for each column in the
** target list of the current command. Format information for
** alternate rows, like compute, is kept in the DBALTHEAD and
** DBALTINFO structures.
*/
struct dbcolinfo
{
char colname[DBMAXCOLNAME+1];/* column name */
BYTE coltype; /* column type */
DBINT coludtype; /* user-defined type */
DBINT collen; /* max length of column */
DBINT colprlen; /* max printing length of column */
char *colcontrol; /* control format, if any */
struct bindrec colbind; /* binding info, if any */
int coltable; /* for browse mode: which table
* did this column come from?
*/
BYTE colstatus; /* for browse mode: what kind of column
* is this?
*/
char colorigname[DBMAXCOLNAME+1];/* for browse mode: what is the name
* of the table column that provided
* this select-list member?
*/
char *coltxobjname; /* the SQL Server always returns the
* qualified object-name for TEXT
* columns.
*/
struct dbcolinfo *colnext; /* next column */
};
typedef struct dbcolinfo DBCOLINFO;
/*
** DBTABNAME - This structure contains information about the tables which
** were used to produce the current set of results. The SQL Server only
** provides this info for queries that are executed in "browse mode".
**
** There is a linked list of DBTABNAME structures in the DBPROCESS
** structure. There is one DBTABNAME structure for each table used to
** produce the target list of the current command.
**
** If this query was executed without "browse mode", then this list will
** have no members.
*/
struct dbtabname
{
char tabname[DBMAXNAME+1]; /* column name */
struct dbtabname *tabnext; /* next column */
};
typedef struct dbtabname DBTABNAME;
/*
** DBRETVAL - This structure contains any data which was returned as a function
** value by the last command. Currently, "browse-mode" updates are the only
** commands which return function values.
**
** There is a linked list of DBRETVAL structures in the DBPROCESS
** structure. There is one DBRETVAL structure for each function value
** returned by the current command.
**
** If this command returned no function value, this list will
** have no members.
*/
struct dbretval
{
char retname[DBMAXNAME+1]; /* value name */
BYTE retvalstat; /* status byte */
BYTE rettype; /* value type */
BYTE retmaxlen; /* max value length (ignored) */
BYTE retlen; /* value length */
DBINT retusertype; /* user type */
BYTE *retdata; /* the return-value itself. */
struct dbretval *retnext; /* next return-value */
};
typedef struct dbretval DBRETVAL;
/*
** DBALTHEAD - This structure contains information for ALT rows. ALT
** rows are COMPUTE results. There is one DBALTHEAD for each COMPUTE
** statement. All the COMPUTE operators in a particular COMPUTE statement
** must have the same bylist -- this is enforced by the SQL Server.
** Off of each DBALTHEAD is a linked list of DBALTINFO structures that
** describe the format for each particular COMPUTE operation in the
** COMPUTE.
*/
struct dbalthead
{
DBUSMALLINT althid; /* id for this COMPUTE statement */
BYTE althalts; /* number of DBALTINFO structures in althlist */
BYTE althsizeby; /* number of elements in the bylist */
BYTE althbylist[DBMAXBYLIST]; /* colids of bylist elements */
struct dbaltinfo *althlist; /* linked list of DBALTINFOs */
struct dbprlist *althprlist; /* order print list for aops */
struct dbalthead *althnext; /* next dbalthead */
};
typedef struct dbalthead DBALTHEAD;
typedef struct dbxlate
{
void *bufstart; /* For use when freeing translation tables. */
void *xlate; /* Points to an INTL_XLATE structure. */
} DBXLATE;
/*
** DBPRLIST - This structure is used to create an 'ordered' printing list
** for computes. For example a compute might be:
** compute sum(col1), avg(col2), sum(col2), avg(col3), avg(col1)
** For printing, it would be nice to have a list that pointed to the
** right DBALTINFO structures like this:
** sum(col1)-->sum(col2)
** |
** \|/
** avg(col1)-->avg(col2)-->avg(col3)
** It is used by the praltrow function that dbprrow uses but the
** information could be used by any DBLIB client.
*/
struct dbprlist
{
DBROWDATA *prdata; /* actual data for the compute */
struct dbaltinfo *prtarget; /* related ALTINFO struct */
struct dbprlist *prright; /* next aop in compute */
struct dbprlist *prdown; /* next compute in query */
};
typedef struct dbprlist DBPRLIST;
/*
** DBALTINFO - This structure contains the format information about
** alternate rows. Compute clauses produce alternate rows of data,
** interspersed with the regular data rows returned by the dataserver.
** There is a linked list of DBALTHEAD structures in the DBPROCESS
** structure. There is one DBALTHEAD structure for each possible
** type of alternate row of the current command. Format information for
** regular data rows is kept in the DBCOLINFO structure.
*/
struct dbaltinfo
{
char *altname; /* null terminated string to alt header */
BYTE alttoken; /* type of alternate information */
BYTE altcolid; /* which target list member referenced */
BYTE alttype; /* column type */
DBINT altudtype; /* user-defined type */
DBINT altlen; /* max length of column */
DBINT altprlen; /* printing length of data */
char *altcontrol; /* control format, if any */
struct dbprlist *altprlist; /* ptr to ordered printing list */
struct bindrec altbind; /* binding info, if any */
struct dbaltinfo *altnext; /* next column */
};
typedef struct dbaltinfo DBALTINFO;
/*
** DBROW - This structure is used to store the actual row and alternate row
** data returned by the dataserver. The member of the DBPROCESS structure
** called dbfirstdata stores the doubly-linked list of rows. If buffering
** is off, only one row is stored. The rows are stored in the order that
** they are received from the server.
*/
struct dbrow
{
DBINT rowid; /* this is the returned row number */
DBUSMALLINT rowaltid; /* for ALT rows, this is
* DBALTINFO.altid
*/
DBROWDATA *rowdata; /* actual data */
DBBOOL rowhasnull; /* are there any NULLS in this row of
* data?
*/
struct dbrow *rowprev; /* previous row if buffering on */
struct dbrow *rownext; /* next row if buffering on */
SECLAB dbseclab; /* security label */
unsigned long dbcrc; /* row crc */
};
typedef struct dbrow DBROW;
/*
** DBINFO - This structure is used to store information and error messages
** returned by the dataserver.
**
** NOTE - This structure is used by APT.
** Adding or deleting structure members should be done with
** care.
*/
struct dbinfo
{
DBINT infonum; /* error or info number */
DBTINYINT infostate; /* error state number */
DBTINYINT infoclass; /* info class or error severity */
char *infotext; /* null terminated message */
char *infoservname; /* null terminated Server-name */
char *infoprocname; /* null terminated procedure-name */
DBUSMALLINT infolinenum; /* stored-procedure line-number */
struct dbinfo *infonext;
};
typedef struct dbinfo DBINFO;
/*
** Options - both for the dataserver and DBLIB
** As additional options are added, they should be added here and in
** the Dboptdict array.
*/
/*
** dataserver options are defined in pss.h
** dataserver options and their index into the Dboptdict array
** Dboptdict is defined in options.c
*/
#define DBPARSEONLY 0
#define DBESTIMATE 1
#define DBSHOWPLAN 2
#define DBNOEXEC 3
#define DBARITHIGNORE 4
#define DBNOCOUNT 5
#define DBARITHABORT 6
#define DBTEXTLIMIT 7
#define DBBROWSE 8
#define DBOFFSET 9
#define DBSTAT 10
#define DBERRLVL 11
#define DBCONFIRM 12
#define DBSTORPROCID 13
#define DBBUFFER 14
#define DBNOAUTOFREE 15
#define DBROWCOUNT 16
#define DBTEXTSIZE 17
#define DBNATLANG 18
#define DBDATEFORMAT 19
#define DBPRPAD 20
#define DBPRCOLSEP 21
#define DBPRLINELEN 22
#define DBPRLINESEP 23
#define DBLFCONVERT 24
#define DBNUMOPTIONS 25 /* total number of Db-Lib options */
#define DBPADOFF 0
#define DBPADON 1
#define OFF 0
#define ON 1
/* RETCODES for option routines */
#define NOSUCHOPTION 2
/*
** DBOPTION - This structure is used to store the current dataserver and
** dblib options.
*/
#define MAXOPTTEXT 32
struct dboption
{
char opttext[MAXOPTTEXT];
DBSTRING *optparam; /* param to the option */
DBUSMALLINT optstatus; /* status of option */
DBBOOL optactive; /* is this structure active (being used?) */
struct dboption *optnext; /* for different versions of an option */
};
typedef struct dboption DBOPTION;
/*
** These are the offset types recognized by the SQL Server
** They are contained in the SQL Server header pss.h. The _defines
** come from y.tab.h.
*/
#define OFF_SELECT (DBUSMALLINT) _SELECT
#define OFF_EXEC (DBUSMALLINT) _EXECUTE
#define OFF_FROM (DBUSMALLINT) _FROM
#define OFF_ORDER (DBUSMALLINT) _ORDER
#define OFF_COMPUTE (DBUSMALLINT) _COMPUTE
#define OFF_TABLE (DBUSMALLINT) _TABLE
#define OFF_PROCEDURE (DBUSMALLINT) _PROCEDURE
#define OFF_STATEMENT (DBUSMALLINT) _STATEMENT
#define OFF_PARAM (DBUSMALLINT) _PARAM
/*
** DBOFF - This structure is used to store text offset information.
** This information is used to send back to the dataserver new
** control formats.
*/
struct dboff
{
DBUSMALLINT offtype; /* type of offset */
DBUSMALLINT offset; /* actual offset */
struct dboff *offnext;
};
typedef struct dboff DBOFF;
/*
** DBDONE - This structure is just the dataserver done packet.
** It has information about the completion of a command.
*/
struct dbdone
{
DBUSMALLINT donestatus; /* done status bits */
DBUSMALLINT doneinfo; /* command specific info */
DBINT donecount; /* done count -- rows for example */
};
typedef struct dbdone DBDONE;
/* Status bits for DBPROCESS dbstatus */
#define READROW ((DBINT) 0x2)
#define INSPROC ((DBINT) 0x4)
#define EXECDONE ((DBINT) 0x8)
#define NEWDB ((DBINT) 0x10)
#define DB__INRPC ((DBINT) 0x20)
#define DB__INEVENTRAISE ((DBINT) 0x40)
#define DB__INEVENTCREATE ((DBINT) 0x80)
#define DB__GOTEVENT ((DBINT) 0x0100)
#define DB__PASSTHRU ((DBINT) 0x0200)
#define DB__TDSPRINTFUNC ((DBINT) 0x0400)
#define DB__INLINENOTIFY ((DBINT) 0x0800)
#define DB__READING_NOTIFY ((DBINT) 0x1000)
#define DB__IN_EVENT_HANDLER ((DBINT) 0x2000)
#define DB__TEXTPARAMS ((DBINT) 0x4000)
#define DB__POLLEVENT ((DBINT) 0x8000)
#define DBCANCELLING ((DBINT) 0x10000)
#define DBTIMING_OUT ((DBINT) 0x20000)
/* Possible flags for dbback_compatible(). Currently the only
** one is DBEXTRARESULTS.
*/
#define DBEXTRARESULTS (DBUSMALLINT) 0x1
/* Bulk-copy information -- */
#define PERIOD '.' /* the separator... */
#define STATNULL (BYTE) 0x08
#define IN (BYTE) 1 /* TEMPORARY - for backward compatibility. */
#define OUT (BYTE) 2 /* TEMPORARY - for backward compatibility. */
#define DB_IN (BYTE) 1
#define DB_OUT (BYTE) 2
#define BCPNAMELEN 255
#define DEFABORT 10 /* # of errors before we give up */
#define ERRFILE "bcp.error" /* default error file name */
/* BCP macros: */
#define BCP_SETL(a,b) dbsetlbool((a), (b), DBSETBCP)
/* The fields for calls to bcpcontrol. */
#define BCPMAXERRS 1
#define BCPFIRST 2
#define BCPLAST 3
#define BCPBATCH 4
#define BCPERRFILE 5 /* TEMPORARY - for backward compatibility. */
/* This macro is used by the Non-C interfaces to BCP-Library: */
#define BCP_HOSTTYPE(a, b) bcp_hosttype(a, b)
typedef struct bcpparsetable
{
char dbname[DBMAXNAME+1];
char ownername[DBMAXNAME+1];
char tabname[DBMAXNAME+1];
} BCPPARSETABLE;
/*
** BCPCOLDESC
** This is the basic unit of information used for bulkcopy.
** All the bulkcopy routines that talk with the SQL Server
** routines pass an array of these.
*/
typedef struct bcpcoldesc
{
BYTE *cd_dvalue; /* current value to be inserted */
BYTE *cd_defvalue; /* default value to be inserted */
DBINT cd_dlen; /* current length to be inserted */
DBINT cd_deflen; /* length of default to be inserted */
DBINT cd_colen; /* max length allowed in column */
short cd_coloff; /* column offset in row */
BYTE cd_colid; /* id of column */
BYTE cd_type; /* storage type of column */
BYTE cd_status; /* status bits */
DBBOOL cd_nullok; /* is a NULL ok here? */
char cd_name[DBMAXNAME+1]; /* column name */
DBBOOL cd_moretext; /* Is this text to be sent via bcp__moretext? */
long cd_textpos; /* file-position of a long TEXT or IMAGE */
} BCPCOLDESC;
/*
** BCPROWDESC
** This is the basic unit of information used for bulkcopy.
** All the bulkcopy routines that talk with the SQL Server
** routines pass it.
*/
typedef struct bcprowdesc
{
BCPCOLDESC *rd_coldesc; /* ptr to base address of COLDESC
* array
*/
short rd_colcount; /* number of columns in COLDESC */
short rd_minlen; /* minimum length of a row */
short rd_maxlen; /* maximum length of a row */
} BCPROWDESC;
/*
** BCPHOSTDESC
** This is the structure that has information about the type and
** format of the input or output data. An array of these is used
** to read/write data to or from the host.
*/
typedef struct bcphostdesc
{
BCPCOLDESC *h_tabcol; /* which table column we are referring to */
int h_tabcolnum; /* which table column we are referring to */
DBINT (*hconvert)(); /* conversion function, if applicable */
BYTE htype; /* host data type for this column */
DBINT hcollen; /* max length of hostfile column */
BYTE *hdata; /* host-format data for this column */
DBINT hdatlen; /* length of actual hostfile data */
BYTE *hxdata; /* This buffer holds the host-format data
* after it has been translated from
* one character-set to another.
*/
DBINT hxbuflen; /* The length of the hxdata buffer. */
DBINT hxdatlen; /* This is the length of the hostfile data,
* after it has undergone any character-set
* translation.
*/
int hprefixlen; /* length of length-prefix for this column */
BYTE *hterm; /* terminator for this column, if applicable */
int htermlen; /* length of terminator for this column */
DBBOOL hmoretext; /* Is this text to be sent via
* bcp__moretext?
*/
long htextpos; /* file-position of a long TEXT or IMAGE */
} BCPHOSTDESC;
/* This structure contains information about any partially-sent TEXT or IMAGE
* values, which are still to be sent by bcp_moretext().
*/
typedef struct bcptextrec
{
DBINT len;
BYTE *val;
BYTE type;
DBSMALLINT rowoffset;
BYTE coloffset;
} BCPTEXTREC;
/*
** BCPDESC
** This structure is used to pass the information contained in the
** Bulk Copy property sheet around (if in the form version), or
** information typed in by the user (in dblib/stand alone version).
** In the form version, this information comes from the main form, while
** in the stand alone version this comes from the command line.
*/
typedef struct bcpdesc
{
BCPROWDESC *bd_rowdesc; /* the associated rowdesc */
BCPHOSTDESC *bd_hostdesc; /* ptr to base address of
* BCPHOSTDESC array
*/
DBXLATE *bd_xlt_tosrv; /* For use when transferring
* character strings from the
* front-end to the SQL Server
* (DB_IN).
*/
DBXLATE *bd_xlt_todisp; /* For use when transferring
* character strings from the
* SQL Server to the front-end
* (DB_OUT).
*/
int bd_hcolcount; /* number of (cols) BCPHOSTDESC
** structs */
BCPPARSETABLE *bd_ptable; /* ptr to tbl name components
*/
char bd_table[(3 * DBMAXNAME) + 3]; /* full table name */
char bd_filename[BCPNAMELEN+1];/* host filename */
BYTE bd_direction; /* in/out */
char *bd_errfilename; /* host err file name */
BYTE *bd_errfile; /* host err file pointer */
DBINT bd_abort; /* # of errors allowable */
DBINT bd_firstrow; /* begin copy at this row */
DBINT bd_lastrow; /* end copy at this row */
DBINT bd_batch; /* # of rows per batch */
int bd_textcount; /* # of text-columns in the
* current row.
*/
int bd_textcol; /* # of the text-column now
* being sent by bcp_moretext().
* Starts at zero.
*/
DBINT bd_textbytes; /* # of bytes already sent of
* the current bcp_moretext()
* column.
*/
BCPTEXTREC *bd_textarray;
} BCPDESC;
/* Structures and constants for localization information: */
#define DBMAXMNYSYM 5 /* Max length of a currency symbol. */
#define DBMAXECLEN 8 /* Max length of a DB-Library error-number
* mnemonic.
*/
#define DBMAXESLEN 256 /* Max length of a DB-Library error-string. */
#define DBMAXCPYRTLEN 512 /* Max length of a DB-Library copyright
* notice.
*/
/* Each DBMNYFMT structure defines one of the acceptable money formats
* for a given locale.
*/
typedef struct dbmnyfmt
{
DBBOOL symbol_first; /* Should this currency symbol
* appear before the currency
* amount?
*/
char symbol[DBMAXMNYSYM+1]; /* The money-symbol itself. */
struct dbmnyfmt *next;
} DBMNYFMT;
/* Each DBERRSTR structure will define one of the DB-Library error codes
* for a given locale.
*/
typedef struct dberrstr
{
char errcode[DBMAXECLEN+1];
/* The short mnemonic string
* which describes this error.
*/
char string[DBMAXESLEN+1];
/* The error-string itself. */
} DBERRSTR;
typedef struct dblocale
{
char name[DBMAXNAME+1]; /* This locale's name. */
DBVOIDPTR dateinfo; /* All of the month-names,
* day-names, and date-format
* information for this locale.
* This is defined as a void
* pointer, to avoid exposing
* the INTL_DATEINFO structure
* to customers.
*/
int dateorder; /* An integer code which describes
* this locale's default date-order.
* This code is used by datetime.c.
*/
char copyright[DBMAXCPYRTLEN];
/* The copyright notice, in the
* appropriate language.
*/
DBMNYFMT *moneyfmt; /* A linked-list of money-format
* structures.
*/
DBERRSTR errlist[DBERRCOUNT];
/* An array of error-code
* structures.
*/
int usecount; /* How many DBPROCESSes are
* using this localization
* information? When the count
* drops to zero, this whole
* structure can be freed.
*/
struct dblocale *next;
} DBLOCALE;
/*
** 4.6 additions begin here.
*/
/*
** DBEVENTREC
**
** This structure is used by dblibrary to keep track of event
** notifications, event invocations, and all other event-related
** activities.
*/
typedef struct db__event_rec {
DBCHAR name[DBMAXNAME+1]; /* event name */
DBUSMALLINT status; /* bit field */
DBUSMALLINT options; /* notification flags */
INTFUNCPTR handler; /* event handler */
DBRETVAL *params; /* event parameters */
DBSMALLINT numparams; /* how many params? */
struct db__event_rec *next; /* next event struct. */
} DBEVENTREC;
/*
** DBEVENTREC status bits.
*/
#define DB__PENDING_NOTIFY ((DBUSMALLINT)0x01)
/*
** DBRPCREC
**
** This structure is used by dblib to build a remote procedure call
** data stream.
*/
typedef struct db__rpc_rec {
DBCHAR *name; /* rpc name */
DBUSMALLINT options; /* bit options */
DBRETVAL *params; /* list of params */
DBSMALLINT numparams; /* how many params? */
DBSMALLINT textparams; /* any text/image params? */
DBSMALLINT textsent; /* how many text/image
** parameters have been sent.
*/
DBUSMALLINT status; /* bit field */
} DBRPCREC;
/*
** values for dbrpcrec->status.
*/
#define DB__READ_END_OF_PARAM ((DBUSMALLINT)0x0001)
#define DB__READ_ALL_PARAMS ((DBUSMALLINT)0x0002)
/*
** DBTRACEREC
**
** This structure is used by dblib to store information regarding
** Tabular Data Stream tracing.
*/
typedef struct db__trace_rec {
DBUSMALLINT trace_flag; /* bit field */
DBVOIDPTR outfp;
INTFUNCPTR printfunc; /* trace routine */
struct db__trace_rec *next;
} DBTRACEREC;
/*
** DBTRACEBUF
**
** This structure is used to store trace information that will be
** made available to the user via the dbtracestring() routine.
*/
typedef struct db__tracebuf {
BYTE *tbuf;
DBSMALLINT bufsize;
BYTE *next_byte;
DBSMALLINT bytes_left;
} DBTRACEBUF;
/*
** Trace flag symbols.
*/
#define DBSTOPTRACE ((DBUSMALLINT)0x0001)
#define DBTDSHEADER ((DBUSMALLINT)0x0002)
#define DBTDSDATA ((DBUSMALLINT)0x0004)
#define DBTDSATT ((DBUSMALLINT)0x0008)
#define DBTDSCONNECT ((DBUSMALLINT)0x0010)
#define DBTDSDUMP ((DBUSMALLINT)0x0020)
/*
** DB__TRACEBUF_SIZE - This is the size of the actual data buffer
** that will be allocated by dbtraceon().
*/
#define DB__TRACEBUF_SIZE 3000
/*
** DBLOGINFO - A structure used by TDS passthru login routines
** to communicate login parameters between Open Client and OpenServer.
*/
typedef struct dbloginfo
{
BYTE tds_level[4]; /* The version of TDS to be used. */
DBINT packet_size; /* The TDS packet size to be used. */
BYTE flt8_type; /* Type of SYBFLT8 on this
** platform.
*/
BYTE flt4_type; /* Type of SYBREAL on this
** platform.
*/
BYTE int4_type; /* Type of SYBINT4 on this
** platform.
*/
BYTE int2_type; /* Type of SYBINT2 on this
** platform.
*/
BYTE date_type; /* Type of SYBDATETIME on
** this platform.
*/
BYTE char_type; /* Type of SYBCHAR on this
** platform.
*/
BYTE noshort; /* Whether to convert short
** data types to long values.
*/
BYTE language[MAXNAME]; /* The name of the language to
** be used for this session.
*/
BYTE langlen; /* The length of language[] */
BYTE setlang; /* Whether the language field
** contains a real value.
*/
BYTE charset[MAXNAME]; /* The name of the charset to
** be used for this session.
*/
BYTE charsetlen; /* The length of charset[] */
BYTE setcharset; /* Whether the charset field
** contains a real value.
*/
BYTE ldmpld; /* Dump/load indicator. */
} DBLOGINFO;
/*
** DBCHARSET
**
** This structure is used to hold character set specific information.
** More than one dbproc may reference a given DBCHARSET record, so a
** use count is maintained so we know when we can free the structure.
*/
typedef struct dbcharset
{
char name[DBMAXNAME+1]; /* Name of the character set
** (null-terminated)
*/
DBSMALLINT type; /* Type of the character set */
DBTINYINT id; /* Character set id */
void *char_data; /* Pointer to image data from
** Server. May be NULL.
*/
void *chatr; /* Pointer to structure which provides
** meaning to data pointed to by
** char_data. This structure is filled
** in by the function
** build_char_attrib(). Both the
** structure declaration and the
** function are provided by the
** Server group.
*/
int usecount; /* Number of DBPROCESSes using this
** character set.
*/
struct dbcharset *next; /* Next structure in linked list.
*/
} DBCHARSET;
/*
** DBPROCESS - This is the basic DBLIB structure. It contains the command
** sent to the dataserver as well as the results of the command.
** It also includes any error or information messages, including the
** done packet, returned by the dataserver. If buffering is turned on,
** this structure also stores the data rows.
*/
struct dbprocess
{
struct servbuf *dbfile; /* dataserver connection */
DBINT dbstatus; /* status field for dbprocess */
BYTE dbtoken; /* current dataserver token */
DBSTRING *dbcmdbuf; /* command buffer */
int dbcurcmd; /* number of the current cmd results */
DBINT dbprocid; /* procid, if any, of the current cmd */
DBCOLINFO *dbcols; /* linked list of column information */
DBALTHEAD *dbalts; /* linked list of alt column info */
DBROW *dbfirstdata; /* doubly linked list of returned row
* data
*/
DBROW *dbcurdata; /* current row in dbfirstdata */
DBROW *dblastdata; /* last row in dbfirstdata, usually
* dbcurdata
*/
DBOFF *dboffsets; /* list of offsets and controls in
* dbcmdbuf
*/
int dboffadjust; /* adjustment factor for offsets */
DBSMALLINT dbcuroffset; /* active offset for results */
DBOPTION *dbopts;
DBSTRING *dboptcmd; /* option string to send to server */
DBINFO *dbmsgs; /* linked list of info and error
* messages
*/
DBINFO *dbcurmsg; /* last message read by dbgetmsg() */
DBDONE dbdone; /* done information */
char dbcurdb[DBMAXNAME+1]; /* the name of the current
* database
*/
int (*(*dbbusy)())(); /* function to call when waiting on
* dataserver
*/
void (*dbidle)(); /* function to call when waiting on
* dataserver
*/
int (*dbchkintr)(); /* user's function to call to check for
* queued interrupts
*/
int (*dbhndlintr)();/* user's interrupt handler */
int dbbufsize; /* the size of the row buffer, if
* enabled
*/
NULLBIND dbnullbind; /* what to bind for nulls */
int dbsticky; /* sticky flags like attn */
int dbnumorders; /* number of columns in the query's
* "order by" clause.
*/
int *dbordercols; /* array of the column numbers found in
* the query's "order by" clause.
*/
DBBOOL dbavail; /* is this dbproc available for general
* use?
*/
int dbftosnum; /* this id is used when recording the
* frontend-to-Server SQL traffic of
* this DBPROCESS.
*/
DBBOOL dbdead; /* TRUE if this DBPROCESS has become
* useless, usually due to a fatal
* Server error, or a communications
* failure.
*/
DBBOOL dbenabled; /* TRUE if this DBPROCESS is allowed to
* be used in DB-LIBRARY functions. The
* user may set this flag FALSE,
* possibly within an error handler, if
* execution of further commands would
* just cause further errors.
* DB-LIBRARY initially sets this flag
* TRUE. The user may set and re-set
* this flag at will.
*/
DBBOOL dbsqlsent; /* TRUE if the SQL in the command
* buffer has already been sent to
* the SQL Server.
*/
DBTABNAME *dbtabnames; /* linked-list of table-name
* information used by "browse mode".
*/
DBINT dbspid; /* The Server process-id of this
* DBPROCESS. It's returned in the
* row-count field of the done-packet
* which signifies a successful login.
*/
DBRETVAL *dbretvals; /* linked-list of function
* return-values.
*/
BCPDESC *db_bcpdesc; /* A structure containing bulk-copy
* information.
*/
DBBOOL dbtransbegun; /* Indicates that a text data transfer
* is under way.
*/
DBINT dbbytesleft; /* This is a countdown variable, used
* to track the number of bytes which
* are still to be sent as part of
* a dbwritetext() command. Or, in
* dbreadtext() as the number still
* to read on the net.
*/
DBINT dbretstat; /* This is the return-status from
* a stored procedure.
*/
DBBOOL dbhasretstat; /* Is the return-status valid? */
DBINT dbtextlimit; /* This is the longest text-column
* that this dbproc will accept
* from the Server. Any additional
* bytes will be discarded.
* If 0, then there's no limit.
*/
BYTE *dbuserdata; /* A pointer to any data that the
* the user wishes to associate with
* this DBPROCESS.
*/
DBINT dbmsgno; /* The number of the Server message
*/
char dblogin_node[DBMAXNAME + 1];
/* The node that the Companion
* Server's redirector has
* recommended to us.
*/
int dbcolcount; /* The number of regular columns
* in the current set of results.
*/
DBBOOL db_oldtds; /* TRUE if the TDS version is older
* than 4.0.
*/
int db_tdsversion; /* tds version for this dbproc. */
DBLOCALE *dblocale; /* The localization info for this
* DBPROCESS.
*/
DBVOIDPTR rowfile; /* The file-pointer used by
* dbprrow().
*/
DBINT dbsprlen; /* The current length of a string
* being built up by one of the
* dbspr* functions.
*/
DBINT dbsprmaxlen; /* The maximum length of a buffer
* being filled by one of the dbspr*
* functions.
*/
char *dbsprnextchar; /* The next available character
* of a buffer being filled by one of
* the dbspr* functions.
*/
int dbprlinelen; /* The length of a display line.
* This information is used by
* the dbspr* functions.
*/
#if VMS
int db_event_mask; /* a mask used to determine what
** event has happened in the front-
** end i/o routines.
*/
long db_event_flag; /* the number of the event flag used
** to check for timeout, interrupt
** (control_c) or i/o completion.
*/
short db_io_channel; /* channel assigned to sys$command
** of the controlling process.
*/
short r_iosb[4]; /* I/O status for read */
short w_iosb[4]; /* I/O status for write */
/* for async event notifications */
long db_readflags; /* flags used for buffer and QIO
** synchronization */
long db_recvfl_ast; /* async recvfill_a original ast */
long db_recvfl_astp; /* async recvfill_a original astp */
long db_recvfl_fr; /* async recvfill_a original final_result */
long db_rp_fr; /* pending readfill_a final_result */
void *dbpoll_ast; /* Structure containing information
** needed during asynchronous dbpoll().
*/
#endif /* VMS */
DBRPCREC *db_rpcrec; /* rpc record */
DBVOIDPTR db_events; /* table of event structs */
DBEVENTREC *db_curevent; /* the current event */
DBEVENTREC *db_defeventrec; /* the default eventrec */
DBCHAR *db_waitevent; /* the name of the event being waited
** for synchronously. This field is
** only valid if dbstatus has the
** DB_INLINENOTIFY bit is set.
*/
DBUSMALLINT db_traceflags; /* active traces */
DBTRACEREC *db_tracerec; /* trace structure */
DBTRACEBUF *db_tracebuf; /* the trace data itself */
DBINT db_traceid; /* the id of this dbproc. */
BYTE db__priv[8];
DBBOOL first_token_read;
/* This field is set when
* the first token of a server
* response has been read by
* dbpoll().
*/
DBINT db_packetsize; /* The packet size being used by
** this DBPROCESS.
*/
DBBOOL use_logintime; /* If this field is set TRUE,
* it indicates that this
* DBPROCESS should use the
* DbLoginSecs timeout value,
* instead of the usual DbTimeout.
*/
DBBOOL dbuse_in_progress;
/* If this field is set TRUE,
* it indicates that this DBPROCESS
* is in the middle of a dbuse()
* operation, and should use the
* dbuse() error- and message-handlers.
*/
DBBOOL textok_in_progress;
/* If this field is set TRUE,
* it indicates that this DBPROCESS
* is in the middle of a db__textok()
* operation, and should use the
* db__textok() error- and
* message-handlers.
*/
DBBOOL textok; /* This field indicates whether
* or not the server which is
* connected to this DBPROCESS
* can handle TEXT and IMAGE data.
*/
DBBOOL recovering; /* If this field is set TRUE, it
* indicates that a dbuse() operation
* is continuing to attempt to
* access a database which is
* still recovering.
*/
char servcharset[DBMAXNAME+1];
/* The name of the server's character
** set.
*/
char charset[DBMAXNAME+1];
/* The name of the character set
** currently in use.
*/
DBCHARSET *charset_info; /* Pointer to information about the
** current character set.
*/
DBBOOL charset_cnv; /* Indicates whether the server
** can convert from/to its character
** set to the Clients character set.
** TRUE means the conversion is being
** done.
*/
DBBOOL need_charset_info;
/* Indicates whether we need to
** load character set info from the
** Server.
*/
DBUSMALLINT envchange_rcv; /* Bit mask indicating whether
** TDS ENVCHANGE packets were received.
*/
DBROWDATA *db_readtext; /* Place to hold text timestamp and
** text pointer when reading text
** rows via dbreadtext().
*/
DBINT requested_packetsize;
/* packet size requested
** by user via DBSETLPACKET().
*/
struct dbprocess *dbnext;/* DBPROCESSes are kept track of
* in a big linked-list.
*/
};
typedef struct dbprocess DBPROCESS;
#define DBTDS_UNKNOWN 0
#define DBTDS_2_0 1 /* used by pre 4.0 SQL Server */
#define DBTDS_3_4 2 /* used by Microsoft SQL Server (3.0) */
#define DBTDS_4_0 3 /* used by 4.0 SQL Server */
#define DBTDS_4_2 4 /* used by 4.2 SQL Server */
#define DBTDS_4_6 5 /* used by 2.0 OpenServer and
** 4.6 SQL Server.
*/
/*
** Possible values for the envchange_rcv field.
*/
#define DB__DB_ENVCHANGE ((DBUSMALLINT) 0x0001)
#define DB__LANG_ENVCHANGE ((DBUSMALLINT) 0x0002)
#define DB__CHAR_ENVCHANGE ((DBUSMALLINT) 0x0004)
#define DB__PACKET_ENVCHANGE ((DBUSMALLINT) 0x0008)
/*
** Various macros used to extract information from the DBPROCESS structure
*/
#define DBTDS(a) dbtds(a)
#define DBCURCMD(a) dbcurcmd(a)
#define DBCURROW(a) dbcurrow(a)
#define DBFIRSTROW(a) dbfirstrow(a)
#define DBLASTROW(a) dblastrow(a)
#define DBROWTYPE(a) dbrowtype(a)
#define DBMORECMDS(a) dbmorecmds(a)
#define DONECONTINUE(a) donecontinue(a)
#define DBCOUNT(a) dbcount(a)
#define DBCMDROW(x) dbcmdrow(x)
#define DBROWS(x) dbrows(x)
#define DBNUMORDERS(a) dbnumorders(a)
#define DBBUFFULL(a) dbbuffull(a)
#define DBMOREROWS(a) dbmorerows(a)
#define DBISAVAIL(a) dbisavail(a)
#define DBDEAD(a) dbdead(a)
#define DBIORDESC(a) dbiordesc(a)
#define DBIOWDESC(a) dbiowdesc(a)
#define DBRBUF(a) dbrbuf(a)
#define DBGETTIMEOUT(a) db__getDbTimeout(a)
#define DBGETTIME() db__getDbTimeout((DBPROCESS *)0)
#if (VMS)
#define DBZEROSPACE(dest, bytes) db__bzero(dest, bytes)
#else
#define DBZEROSPACE(dest, bytes) MEMZERO(dest, bytes)
#endif /* (VMS) */
/*
** These constants are used for RPC options.
*/
#define DBRPCRECOMPILE ((DBUSMALLINT)0x0001)
#define DBNOTIFYALL ((DBUSMALLINT)0x0002)
#define DBNOTIFYNEXT ((DBUSMALLINT)0x0004)
/*
** These constants are used for RPC parameter status values.
*/
#define DBRPCNORETURN ((BYTE)0)
#define DBRPCRETURN ((BYTE)1)
#define DB__NODEFAULT ((BYTE)2)
/*
** This constant is used in dbregparam() to define
** a parameter that has no default data value.
*/
#define DBNODEFAULT ((DBINT)-2)
/*
** dbgetlusername() will return DBTRUNCATED if it truncated the user name.
*/
#define DBTRUNCATED -1
/*
** Internal Remote procedure call names used by Event Manager.
** These names must match the names used by Open/SQL Server.
*/
#define DB__EVENTNOTIFY_RPC "sp_regwatch"
#define DB__CANCELNOTIFY_RPC "sp_regnowatch"
#define DB__ADD_EVENT_RPC "sp_regcreate"
#define DB__DROPEVENT_RPC "sp_regdrop"
#define DB__EVENTLIST_RPC "sp_reglist"
#define DB__NOTIFYLIST_RPC "sp_regwatchlist"
/*
** Define the legal values for the dbregwatch() options parameter.
** These may be OR-able symbols.
*/
#define DBNOTIFYONCE ((DBUSMALLINT)0x0002)
#define DBNOTIFYALWAYS ((DBUSMALLINT)0x0004)
#define DBSYNC ((DBUSMALLINT)0x0020)
#define DBASYNC ((DBUSMALLINT)0x0040)
#define DBWAIT ((DBUSMALLINT)0x0022)
#define DBNOWAITONE ((DBUSMALLINT)0x0042)
#define DBNOWAITALL ((DBUSMALLINT)0x0044)
/*
** new function return codes.
*/
#define DB_PASSTHRU_MORE ((RETCODE)1)
#define DB_PASSTHRU_EOM ((RETCODE)2)
#define DBNOPROC ((RETCODE)2)
/*
** definition of a TDS packet size.
*/
#define DB__PACKET_SIZE ((DBINT)512)
#define DB__MIN_PACKET_SIZE ((DBINT)256)
#define DB__MAX_PACKET_SIZE ((DBINT)9999)
#if VMS
/* These constants are used for VMS network manipulation. */
#define DB_IO_EVENT 1
#define DB_INTERRUPT_EVENT 2
#define DB_TIMER_EVENT 4
#endif /* VMS */
/*
** Macros to set values in the LOGINREC structure.
*/
#define DBSETHOST 1
#define DBSETUSER 2
#define DBSETPWD 3
#define DBSETHID 4
#define DBSETAPP 5
#define DBSETBCP 6
#define DBSETNATLANG 7
#define DBSETNOSHORT 8
#define DBSETHIER 9
#define DBSETCHARSET 10
#define DBSETPACKET 11
#define DBSETLHOST(a,b) dbsetlname((a), (b), DBSETHOST)
#define DBSETLUSER(a,b) dbsetlname((a), (b), DBSETUSER)
#define DBSETLPWD(a,b) dbsetlname((a), (b), DBSETPWD)
#define DBSETLHID(a,b) dbsetlname((a), (b), DBSETHID)
#define DBSETLAPP(a,b) dbsetlname((a), (b), DBSETAPP)
#define DBSETLNATLANG(a,b) dbsetlname((a), (b), DBSETNATLANG)
#define DBSETLNOSHORT(a,b) dbsetlbool((a), (b), DBSETNOSHORT)
#define DBSETLHIER(a,b) dbsetlshort((a), (b), DBSETHIER)
#define DBGETLHIER(a) dbgetlhier(a)
#define DBSETLROLE(a,b) dbsetlrole(a,b)
#define DBSETLCOMP(a,b) dbsetlcomp(a,b)
#define DBSETLPACKET(a,b) dbsetllong((a), (b), DBSETPACKET)
#define DBSETLCHARSET(a,b) dbsetlname((a), (b), DBSETCHARSET)
#define DBSETONECOMP(a,b) (a)[ ((b)-1)/8 ] |= ( 0x80 >> (( (b)-1 ) % 8) )
#ifndef COMPILE_STYLE
#define COMPILE_STYLE KR_C_COMPILE
#endif
#ifndef TYPE_TOKEN_1
#define TYPE_TOKEN_1
#endif
#ifndef TYPE_TOKEN_2
#define TYPE_TOKEN_2
#endif
#if ((COMPILE_STYLE == ANSI_C_COMPILE) || (COMPILE_STYLE == CPP_COMPILE))
/* This may eventually need to be moved up earlier in the file: */
#ifndef FILE
#include <stdio.h>
#endif
/* bcp functions */
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 bcp_getl(LOGINREC *);
extern TYPE_TOKEN_1 BCPDESC TYPE_TOKEN_2 *bcpinit(LOGINREC
*,char *,char *,char *,BYTE);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcpcontrol(BCPDESC
*,int,BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcpcolumn(BCPDESC *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcpformat(BCPDESC
*,int,int,char *,BYTE,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcpexec(BCPDESC *,DBINT *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcpbind(BCPDESC *,BYTE
*,int,char *,int,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcpsendrow(BCPDESC *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcpabort(BCPDESC *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcpcollen(BCPDESC *,int,int);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 bcpdone(BCPDESC *);
/*
** external declaration for functions referenced in this file as macros
** and were once macros
*/
extern TYPE_TOKEN_1 BYTE TYPE_TOKEN_2 bcp_hosttype(DBPROCESS *,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbtds(DBPROCESS *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbcurcmd(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbcurrow(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbfirstrow(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dblastrow(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbrowtype(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbmorecmds(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 donecontinue(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbcount(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbcmdrow(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbrows(DBPROCESS *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbnumorders(DBPROCESS *);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbbuffull(DBPROCESS *);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbmorerows(DBPROCESS *);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbisavail(DBPROCESS *);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbdead(DBPROCESS *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbiordesc(DBPROCESS *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbiowdesc(DBPROCESS *);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbrbuf(DBPROCESS *);
extern TYPE_TOKEN_1 short TYPE_TOKEN_2 dbgetlhier(LOGINREC *);
extern TYPE_TOKEN_1 VOID TYPE_TOKEN_2 dbsetlrole(LOGINREC *,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbsetlcomp(LOGINREC *,BYTE *);
/* Forward declarations of DB-LIBRARY routines */
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 bcp_batch(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_bind(DBPROCESS
*,BYTE *,int,DBINT,BYTE *,int,int,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_colfmt(DBPROCESS
*,int,int,int,DBINT,BYTE *,int,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_collen(DBPROCESS
*,DBINT,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_colptr(DBPROCESS
*,BYTE *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_columns(DBPROCESS *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_control(DBPROCESS *,int,DBINT);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 bcp_done(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_exec(DBPROCESS *,DBINT
*);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_init(DBPROCESS
*,char *,char *,char *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_moretext(DBPROCESS
*,DBINT,BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_readfmt(DBPROCESS *,
char *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_sendrow(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_setxlate(DBPROCESS
*,DBXLATE *,DBXLATE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 bcp_writefmt(DBPROCESS
*,char *);
extern TYPE_TOKEN_1 DBPROCESS TYPE_TOKEN_2 *open_commit(LOGINREC *,char *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 close_commit(DBPROCESS *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 build_xact_string(char
*,char *,DBINT,char *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 start_xact(DBPROCESS
*,char *,char *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 commit_xact(DBPROCESS
*,DBINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 abort_xact(DBPROCESS
*,DBINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 remove_xact(DBPROCESS
*,DBINT,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 scan_xact(DBPROCESS *,DBINT);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 stat_xact(DBPROCESS *,DBINT);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbaltutype(DBPROCESS *,int,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbbind(DBPROCESS
*,int,int,DBINT,BYTE *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbconvert(DBPROCESS
*,int,BYTE *,DBINT,int,BYTE *,DBINT);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbwillconvert(int,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbnullbind(DBPROCESS
*,int,DBINT *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbaltbind(DBPROCESS
*,int,int,int,DBINT,BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbanullbind(DBPROCESS
*,int,int,DBINT *);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbcolbrowse(DBPROCESS *,int);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbtabbrowse(DBPROCESS *,int);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbtabsource(DBPROCESS *,int,int *);
extern TYPE_TOKEN_1 DBBINARY TYPE_TOKEN_2 *dbtsnewval(DBPROCESS *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbtsnewlen(DBPROCESS *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbtabcount(DBPROCESS *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbcolsource(DBPROCESS *,int);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbfreequal(char *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbqual(DBPROCESS *,int,char *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbspid(DBPROCESS *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbtabname(DBPROCESS *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbtsput(DBPROCESS
*,DBBINARY *,int,int,char *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbclrbuf(DBPROCESS *,DBINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbcmd(DBPROCESS *,char *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbfreebuf(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbfcmd(DBPROCESS
*,char *,...);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbcolutype(DBPROCESS *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbback_compatible(DBUSMALLINT,DBBOOL);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 db12hour(DBPROCESS
*,char *);
extern TYPE_TOKEN_1 BYTE TYPE_TOKEN_2 *dbadata(DBPROCESS *,int,int);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbadlen(DBPROCESS *,int,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbaltcolid(DBPROCESS *,int,int);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbaltlen(DBPROCESS *,int,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbaltop(DBPROCESS *,int,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbalttype(DBPROCESS *,int,int);
extern TYPE_TOKEN_1 BYTE TYPE_TOKEN_2 *dbbylist(DBPROCESS *,int,int *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbcancel(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbregnowatch(DBPROCESS
*,DBCHAR *,DBSMALLINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbcanquery(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbreadpage(DBPROCESS
*,char*,DBINT,BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbwritepage(DBPROCESS
*,char*,DBINT,DBINT,BYTE *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbchange(DBPROCESS *);
extern TYPE_TOKEN_1 DBPROCESS TYPE_TOKEN_2 *dbopen(LOGINREC *,char *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbclose(DBPROCESS *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbexit(void);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbgetlusername(LOGINREC
*,BYTE *,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbgetmaxprocs(void);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsetmaxprocs(int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbdate4cmp(DBPROCESS
*,DBDATETIME4 *,DBDATETIME4 *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbdate4zero(DBPROCESS
*,DBDATETIME4 *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbdatechar(DBPROCESS
*,char *,int,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbdatecmp(DBPROCESS
*,DBDATETIME *,DBDATETIME *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbdatecrack(DBPROCESS
*,DBDATEREC *,DBDATETIME *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbdatename(DBPROCESS
*,char *,int,DBDATETIME *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbdateorder(DBPROCESS
*,char *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbdatepart(DBPROCESS
*,int,DBDATETIME *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbdatezero(DBPROCESS
*,DBDATETIME *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbdayname(DBPROCESS
*,char *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbnpcreate(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbnpdefine(DBPROCESS
*,DBCHAR *,DBSMALLINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbregdrop(DBPROCESS
*,DBCHAR *,DBSMALLINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbreginit(DBPROCESS
*,DBCHAR *,DBSMALLINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbreglist(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbregparam(DBPROCESS
*,DBCHAR *,int,DBINT,DBVOIDPTR);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbregexec(DBPROCESS
*,DBUSMALLINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbfreesort(DBPROCESS
*,DBSORTORDER *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbfree_xlate(DBPROCESS
*,DBXLATE *,DBXLATE *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbgetchar(DBPROCESS *,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbgetoff(DBPROCESS
*,DBUSMALLINT,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbreghandle(DBPROCESS
*, DBCHAR *,DBSMALLINT,INTFUNCPTR);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbinit(void);
extern TYPE_TOKEN_1 DBSORTORDER TYPE_TOKEN_2 *dbloadsort(DBPROCESS
*);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbload_xlate(DBPROCESS
*,char *,char *,DBXLATE **,DBXLATE **);
extern TYPE_TOKEN_1 LOGINREC TYPE_TOKEN_2 *dblogin(void);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbloginfree(LOGINREC *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnycopy(DBPROCESS
*,DBMONEY *, DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnyinit(DBPROCESS
*,DBMONEY *,int,DBBOOL *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnyndigit(DBPROCESS
*,DBMONEY *,DBCHAR *,DBBOOL *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnyinc(DBPROCESS
*,DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnydec(DBPROCESS
*,DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnyminus(DBPROCESS
*,DBMONEY *,DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnydown(DBPROCESS
*,DBMONEY *,int,int *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnyscale(DBPROCESS
*,DBMONEY *,int,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnyadd(DBPROCESS
*,DBMONEY *,DBMONEY *,DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnysub(DBPROCESS
*,DBMONEY *,DBMONEY *,DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnydivide(DBPROCESS
*,DBMONEY *,DBMONEY *,DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnymul(DBPROCESS
*,DBMONEY *,DBMONEY *,DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnymaxpos(DBPROCESS
*,DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnymaxneg(DBPROCESS
*,DBMONEY *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbmnycmp(DBPROCESS
*,DBMONEY *,DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmnyzero(DBPROCESS
*,DBMONEY *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmny4copy(DBPROCESS
*,DBMONEY4 *,DBMONEY4 *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmny4minus(DBPROCESS
*,DBMONEY4 *,DBMONEY4 *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmny4add(DBPROCESS
*,DBMONEY4 *,DBMONEY4 *,DBMONEY4 *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmny4sub(DBPROCESS
*,DBMONEY4 *,DBMONEY4 *,DBMONEY4 *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmny4divide(DBPROCESS
*,DBMONEY4 *,DBMONEY4 *,DBMONEY4 *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmny4mul(DBPROCESS
*,DBMONEY4 *,DBMONEY4 *,DBMONEY4 *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbmny4cmp(DBPROCESS
*,DBMONEY4 *,DBMONEY4 *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmny4zero(DBPROCESS
*,DBMONEY4 *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbmonthname(DBPROCESS
*,char *,int,DBBOOL);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbname(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbregwatchlist(DBPROCESS
*);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbregwatch(DBPROCESS
*,DBCHAR *,DBSMALLINT,DBUSMALLINT);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbnumalts(DBPROCESS *,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbnumcompute(DBPROCESS *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbordercol(DBPROCESS *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbpoll(DBPROCESS
*,long,DBPROCESS **,int *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbprtype(int);
extern TYPE_TOKEN_1 STATUS TYPE_TOKEN_2 dbreadtext(DBPROCESS
*,void *,DBINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbresults(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsafestr(DBPROCESS
*,char *,DBINT,char *,DBINT,int);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbsetavail(DBPROCESS *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2
dbsetbusy(DBPROCESS *,void (*(*)())());
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbsetidle(DBPROCESS
*,void (*)());
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsetlname(LOGINREC
*,char *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsetlbool(LOGINREC
*,int,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsetlshort(LOGINREC
*,short,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsetllong(LOGINREC
*,long,int);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbrpwclr(LOGINREC *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbrpwset(LOGINREC
*,char *,char *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsettime(int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsetlogintime(int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsprhead(DBPROCESS
*,char *,DBINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsprline(DBPROCESS
*,char *,DBINT,DBCHAR);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbspr1row(DBPROCESS
*,char *,DBINT);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbspr1rowlen(DBPROCESS
*);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsqlexec(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsqlsend(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsqlok(DBPROCESS *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbstrbuild(DBPROCESS
*, ...);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbstrcmp(DBPROCESS
*,char *,int,char *,int,DBSORTORDER *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbstrcpy(DBPROCESS
*,int,int,char *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbstrlen(DBPROCESS *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbstrsort(DBPROCESS
*,char *,int,char *,int,DBSORTORDER *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbnumrets(DBPROCESS *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbretname(DBPROCESS *,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbrettype(DBPROCESS *,int);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbretlen(DBPROCESS *,int);
extern TYPE_TOKEN_1 BYTE TYPE_TOKEN_2 *dbretdata(DBPROCESS *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbtraceon(DBPROCESS
*,DBUSMALLINT,FILE *,INTFUNCPTR);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbtraceoff(DBPROCESS
*,DBUSMALLINT);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbtracestring(DBPROCESS
*,BYTE *,DBINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbuse(DBPROCESS *,char *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbsetuserdata(DBPROCESS *,BYTE *);
extern TYPE_TOKEN_1 BYTE TYPE_TOKEN_2 *dbgetuserdata(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbwritetext(DBPROCESS
*,char *, DBBINARY *, DBTINYINT, DBBINARY *, DBBOOL, DBINT, BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbmoretext(DBPROCESS
*,DBINT,BYTE *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbxlate(DBPROCESS
*,char *,int,char *,int,DBXLATE *,int *,DBBOOL,int *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbservcharset(DBPROCESS *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbgetcharset(DBPROCESS *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbgetnatlang(DBPROCESS *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbgetpacket(DBPROCESS *);
extern TYPE_TOKEN_1 STATUS TYPE_TOKEN_2 dbgetrow(DBPROCESS *,DBINT);
extern TYPE_TOKEN_1 STATUS TYPE_TOKEN_2 dbsetrow(DBPROCESS *,DBINT);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbcolname(DBPROCESS *,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbcoltype(DBPROCESS *,int);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbcollen(DBPROCESS *,int);
extern TYPE_TOKEN_1 BYTE TYPE_TOKEN_2 *dbdata(DBPROCESS *,int);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbdatlen(DBPROCESS *,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbnumcols(DBPROCESS *);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbvarylen(DBPROCESS *,int);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbrecftos(char *); /* RJD */
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbsetifile(char *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbgetloginfo(DBPROCESS
*,DBLOGINFO **);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsetloginfo(LOGINREC
*,DBLOGINFO *);
extern TYPE_TOKEN_1 STATUS TYPE_TOKEN_2 dbnextrow(DBPROCESS *);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbisopt(DBPROCESS *,int,char *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsetopt(DBPROCESS
*,int,char *,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbclropt(DBPROCESS *,int,char *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbrecvpassthru(DBPROCESS
*,BYTE **);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsendpassthru(DBPROCESS
*,BYTE *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbprhead(DBPROCESS *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbfprhead(DBPROCESS
*,FILE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbprrow(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbfprrow(DBPROCESS
*,FILE *);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbhasretstat(DBPROCESS *);
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbretstatus(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbrpcinit(DBPROCESS
*,char *,DBSMALLINT);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbrpcparam(DBPROCESS
*,char *,BYTE,int,DBINT,DBINT,BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbrpcsend(DBPROCESS *);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbsetinterrupt(DBPROCESS
*,int (*)(),int (*)()); /* RJD */
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsetnull(DBPROCESS *,int,int,BYTE *);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 (*dberrhandle(int (*)()))(); /* RJD */
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 (*dbmsghandle(int (*)()))(); /* RJD */
extern TYPE_TOKEN_1 DBBINARY TYPE_TOKEN_2 *dbtxptr(DBPROCESS *,int);
extern TYPE_TOKEN_1 DBBINARY TYPE_TOKEN_2 *dbtxtimestamp(DBPROCESS *,int);
extern TYPE_TOKEN_1 DBBINARY TYPE_TOKEN_2 *dbtxtsnewval(DBPROCESS *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbtxtsput(DBPROCESS
*,DBBINARY *,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbbufsize(DBPROCESS *);
#if MAC
extern TYPE_TOKEN_1 DBINT TYPE_TOKEN_2 dbtextsize(DBPROCESS
*);
#endif /* MAC */
/* Old API forward declarations */
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbaltname(DBPROCESS
*,int,int);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsettimeout(DBPROCESS
*,int);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dberrstr(int);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dboserrstr(int);
extern TYPE_TOKEN_1 void TYPE_TOKEN_2 dbperror(int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dberrno(void);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbgetmsg(DBPROCESS
*);
extern TYPE_TOKEN_1 DBBOOL TYPE_TOKEN_2 dbsetmsg(DBPROCESS
*,int);
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 dbnummsg(DBPROCESS *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbservermsg(DBPROCESS
*,DBINT *,DBTINYINT *,DBINT *);
extern TYPE_TOKEN_1 char TYPE_TOKEN_2 *dbversion(void);
/*
** The following function is only accessable via the DBGETTIME macros.
*/
extern TYPE_TOKEN_1 int TYPE_TOKEN_2 db__getDbTimeout(DBPROCESS
*);
/* VMS programs can use the AST facility to write asynchronous DB-LIBRARY
* programs.
*/
#if VMS
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbcancel_a(DBPROCESS
*,RETCODE *,void (*)(),BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbcanquery_a(DBPROCESS
*,RETCODE *,void (*)(),BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbnextrow_a(DBPROCESS
*,RETCODE *,void (*)(),BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbopen_a(LOGINREC
*,char *,DBPROCESS *,RETCODE *,void (*)(),BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbresults_a(DBPROCESS
*,RETCODE *,void (*)(),BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsqlexec_a(DBPROCESS
*,RETCODE *,void (*)(),BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbsqlok_a(DBPROCESS
*,RETCODE *,void (*)(),BYTE *);
extern TYPE_TOKEN_1 RETCODE TYPE_TOKEN_2 dbpoll_a(DBPROCESS
*, long, DBPROCESS **, int *, RETCODE *, void (*) (), BYTE *);
#endif /* VMS */
#else
/* bcp functions */
extern DBBOOL bcp_getl();
extern BCPDESC *bcpinit();
extern RETCODE bcpcontrol();
extern RETCODE bcpcolumn();
extern RETCODE bcpformat();
extern RETCODE bcpexec();
extern RETCODE bcpbind();
extern RETCODE bcpsendrow();
extern RETCODE bcpabort();
extern RETCODE bcpcollen();
extern DBINT bcpdone();
/*
** external declaration for functions referenced in this file as macros
** and were once macros
*/
extern BYTE bcp_hosttype();
extern int dbtds();
extern int dbcurcmd();
extern DBINT dbcurrow();
extern DBINT dbfirstrow();
extern DBINT dblastrow();
extern DBINT dbrowtype();
extern DBINT dbmorecmds();
extern DBINT donecontinue();
extern DBINT dbcount();
extern DBINT dbcmdrow();
extern DBINT dbrows();
extern int dbnumorders();
extern DBBOOL dbbuffull();
extern DBBOOL dbmorerows();
extern DBBOOL dbisavail();
extern DBBOOL dbdead();
extern int dbiordesc();
extern int dbiowdesc();
extern DBBOOL dbrbuf();
extern short dbgetlhier();
extern void dbsetlrole();
extern int dbsetlcomp();
/* Forward declarations of DB-LIBRARY routines */
extern DBINT bcp_batch();
extern RETCODE bcp_bind();
extern RETCODE bcp_colfmt();
extern RETCODE bcp_collen();
extern RETCODE bcp_colptr();
extern RETCODE bcp_columns();
extern RETCODE bcp_control();
extern DBINT bcp_done();
extern RETCODE bcp_exec();
extern RETCODE bcp_init();
extern RETCODE bcp_moretext();
extern RETCODE bcp_readfmt();
extern RETCODE bcp_sendrow();
extern RETCODE bcp_setxlate();
extern RETCODE bcp_writefmt();
extern DBPROCESS *open_commit();
extern void close_commit();
extern void build_xact_string();
extern DBINT start_xact();
extern RETCODE commit_xact();
extern RETCODE abort_xact();
extern RETCODE remove_xact();
extern RETCODE scan_xact();
extern int stat_xact();
extern int dbaltutype();
extern RETCODE dbbind();
extern DBINT dbconvert();
extern DBBOOL dbwillconvert();
extern RETCODE dbnullbind();
extern RETCODE dbaltbind();
extern RETCODE dbanullbind();
extern DBBOOL dbcolbrowse();
extern DBBOOL dbtabbrowse();
extern char *dbtabsource();
extern DBBINARY *dbtsnewval();
extern int dbtsnewlen();
extern int dbtabcount();
extern char *dbcolsource();
extern void dbfreequal();
extern char *dbqual();
extern DBINT dbspid();
extern char *dbtabname();
extern RETCODE dbtsput();
extern void dbclrbuf();
extern RETCODE dbcmd();
extern void dbfreebuf();
extern RETCODE dbfcmd();
extern int dbcolutype();
extern RETCODE dbback_compatible();
extern DBBOOL db12hour();
extern BYTE *dbadata();
extern DBINT dbadlen();
extern int dbaltcolid();
extern DBINT dbaltlen();
extern int dbaltop();
extern int dbalttype();
extern BYTE *dbbylist();
extern RETCODE dbcancel();
extern RETCODE dbregnowatch();
extern RETCODE dbcanquery();
extern DBINT dbreadpage();
extern RETCODE dbwritepage();
extern char *dbchange();
extern DBPROCESS *dbopen();
extern void dbclose();
extern void dbexit();
extern int dbgetlusername();
extern int dbgetmaxprocs();
extern RETCODE dbsetmaxprocs();
extern int dbdate4cmp();
extern RETCODE dbdate4zero();
extern RETCODE dbdatechar();
extern int dbdatecmp();
extern RETCODE dbdatecrack();
extern RETCODE dbdatename();
extern char *dbdateorder();
extern DBINT dbdatepart();
extern RETCODE dbdatezero();
extern char *dbdayname();
extern RETCODE dbnpcreate();
extern RETCODE dbnpdefine();
extern RETCODE dbregdrop();
extern RETCODE dbreginit();
extern RETCODE dbreglist();
extern RETCODE dbregparam();
extern RETCODE dbregexec();
extern RETCODE dbfreesort();
extern RETCODE dbfree_xlate();
extern char *dbgetchar();
extern int dbgetoff();
extern RETCODE dbreghandle();
extern RETCODE dbinit();
extern DBSORTORDER *dbloadsort();
extern RETCODE dbload_xlate();
extern LOGINREC *dblogin();
extern void dbloginfree();
extern RETCODE dbmnycopy();
extern RETCODE dbmnyinit();
extern RETCODE dbmnyndigit();
extern RETCODE dbmnyinc();
extern RETCODE dbmnydec();
extern RETCODE dbmnyminus();
extern RETCODE dbmnydown();
extern RETCODE dbmnyscale();
extern RETCODE dbmnyadd();
extern RETCODE dbmnysub();
extern RETCODE dbmnydivide();
extern RETCODE dbmnymul();
extern RETCODE dbmnymaxpos();
extern RETCODE dbmnymaxneg();
extern int dbmnycmp();
extern RETCODE dbmnyzero();
extern RETCODE dbmny4copy();
extern RETCODE dbmny4minus();
extern RETCODE dbmny4add();
extern RETCODE dbmny4sub();
extern RETCODE dbmny4divide();
extern RETCODE dbmny4mul();
extern int dbmny4cmp();
extern RETCODE dbmny4zero();
extern char *dbmonthname();
extern char *dbname();
extern RETCODE dbregwatchlist();
extern RETCODE dbregwatch();
extern int dbnumalts();
extern int dbnumcompute();
extern int dbordercol();
extern RETCODE dbpoll();
extern char *dbprtype();
extern STATUS dbreadtext();
extern RETCODE dbresults();
extern RETCODE dbsafestr();
extern void dbsetavail();
extern void dbsetbusy();
extern void dbsetidle();
extern RETCODE dbsetlname();
extern RETCODE dbsetlbool();
extern RETCODE dbsetlshort();
extern RETCODE dbsetllong();
extern void dbrpwclr();
extern RETCODE dbrpwset();
extern RETCODE dbsettime();
extern RETCODE dbsetlogintime();
extern RETCODE dbsprhead();
extern RETCODE dbsprline();
extern RETCODE dbspr1row();
extern DBINT dbspr1rowlen();
extern RETCODE dbsqlexec();
extern RETCODE dbsqlsend();
extern RETCODE dbsqlok();
extern int dbstrbuild();
extern int dbstrcmp();
extern RETCODE dbstrcpy();
extern int dbstrlen();
extern int dbstrsort();
extern int dbnumrets();
extern char *dbretname();
extern int dbrettype();
extern DBINT dbretlen();
extern BYTE *dbretdata();
extern RETCODE dbtraceon();
extern RETCODE dbtraceoff();
extern DBINT dbtracestring();
extern RETCODE dbuse();
extern void dbsetuserdata();
extern BYTE *dbgetuserdata();
extern RETCODE dbwritetext();
extern RETCODE dbmoretext();
extern int dbxlate();
extern char *dbservcharset();
extern char *dbgetcharset();
extern char *dbgetnatlang();
extern int dbgetpacket();
extern STATUS dbgetrow();
extern STATUS dbsetrow();
extern char *dbcolname();
extern int dbcoltype();
extern DBINT dbcollen();
extern BYTE *dbdata();
extern DBINT dbdatlen();
extern int dbnumcols();
extern DBBOOL dbvarylen();
extern void dbrecftos();
extern void dbsetifile();
extern RETCODE dbgetloginfo();
extern RETCODE dbsetloginfo();
extern STATUS dbnextrow();
extern DBBOOL dbisopt();
extern RETCODE dbsetopt();
extern RETCODE dbclropt();
extern RETCODE dbrecvpassthru();
extern RETCODE dbsendpassthru();
extern void dbprhead();
extern void dbfprhead();
extern RETCODE dbprrow();
extern RETCODE dbfprrow();
extern DBBOOL dbhasretstat();
extern DBINT dbretstatus();
extern RETCODE dbrpcinit();
extern RETCODE dbrpcparam();
extern RETCODE dbrpcsend();
extern void dbsetinterrupt();
extern RETCODE dbsetnull();
extern int (*dberrhandle())();
extern int (*dbmsghandle())();
extern DBBINARY *dbtxptr();
extern DBBINARY *dbtxtimestamp();
extern DBBINARY *dbtxtsnewval();
extern RETCODE dbtxtsput();
extern int dbbufsize();
#if MAC
extern DBINT dbtextsize();
#endif /* MAC */
/* Old API forward declarations */
extern char *dbaltname();
extern RETCODE dbsettimeout();
extern char *dberrstr();
extern char *dboserrstr();
extern void dbperror();
extern int dberrno();
extern char *dbgetmsg();
extern DBBOOL dbsetmsg();
extern int dbnummsg();
extern char *dbservermsg();
extern char *dbversion();
/*
** The following function is only accessable via the DBGETTIME macros.
*/
extern db__getDbTimeout();
/* VMS programs can use the AST facility to write asynchronous DB-LIBRARY
* programs.
*/
#if VMS
extern RETCODE dbcancel_a();
extern RETCODE dbcanquery_a();
extern RETCODE dbnextrow_a();
extern RETCODE dbopen_a();
extern RETCODE dbresults_a();
extern RETCODE dbsqlexec_a();
extern RETCODE dbsqlok_a();
extern RETCODE dbpoll_a();
#endif /* VMS */
#endif /* COMPILE_STYLE */
#endif /* __sybdb__ */